package models;

import play.db.jpa.Model;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Дисциплина
 *
 * User: Администратор
 * Date: 11.06.12
 * Time: 16:08
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name = "schedule")
public class Schedule extends Model {

    @ManyToOne(targetEntity = Group.class, fetch = FetchType.LAZY)
    public Group group;
    public String dayOfWeek;
    public String startTime;
    public String dates;
    @ManyToOne(targetEntity = Discipline.class, fetch = FetchType.LAZY)
    public Discipline discipline;
    public String formOfLessons;
    @ManyToOne(targetEntity = Place.class, fetch = FetchType.LAZY)
    public Place place;
    @ManyToOne(targetEntity = User.class, fetch = FetchType.LAZY)
    public User professor;

    public Schedule(Group group, String dayOfWeek, String startTime, String dates,
                    Discipline discipline, String formOfLessons, Place place, User professor) {
        this.group = group;
        this.dayOfWeek = dayOfWeek;
        this.startTime = startTime;
        this.dates = dates;
        this.discipline = discipline;
        this.formOfLessons = formOfLessons;
        this.place = place;
        this.professor = professor;
    }

}
